const fs = require('fs');

const parser = require('@babel/parser');

const config = require("../webpack.config");

const fileContent = fs.readFileSync(config.entry,"utf-8");

console.log(fileContent);
// 解析ast
const ast = parser.parse(fileContent,{sourceType:"module"});

console.log(ast);